import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import layout from "./views/layout.vue";

const routes: RouteRecordRaw[] = [
  {
    path: "/",
    component: layout,
    redirect: "/home",
    children: [
      {
        path: "home",
        component: () => import("@/views/home/index.vue"),
      },
    ],
  }
];

const Router = createRouter({
  history: createWebHistory(),
  routes,
});

// 跳转后返回顶部
Router.afterEach(() => {
  //window.scrollTo(0,0);
})

export default Router;
